import Quick from ".";
import { WeaInput, WeaLocaleProvider } from 'ecCom';
const { getLabel } = WeaLocaleProvider;

export default class Main extends Quick {
    state = {
        fieldName: ''
    }
    getComponent = () => {
        const { fieldName } = this.state;
        return [
            <div>
                <WeaInput ecId={`${this && this.props && this.props.ecId || ''}_WeaInput@3k63is@`}
                    style={{ width: 200 }}
                    placeholder={getLabel('528639','请输入字段名称')}
                    value={fieldName}
                    onChange={v => this.setState({ fieldName: v })}
                />
            </div>
        ]
    }
    getTitle = () => {
        return 'excel.convertFieldNameToId';
    }
    getScript = () => {
        return `excel.convertFieldNameToId('${this.state.fieldName}');`
    }
}